package cn.cy.behavior.observer.inter.pattern;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-11
 */
public class FundDisplay implements Observer {

    private Fund fund;

    public FundDisplay(Fund fund) {
        this.fund = fund;
        fund.attach(this);
    }

    @Override
    public void update(double price) {
        System.out.println("Fund " + fund.getName() + " price updated to " + price);
    }

}
